From 85233d191b42f31a02d94f686026aaea4da17f41 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Wed, 5 Apr 2006 17:37:31 +0000 Subject: [PATCH] Memory leak fixes. --- interpolate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/interpolate.c b/interpolate.c index f9cbdb2d7..9a4755bb7 100644 --- a/interpolate.c +++ b/interpolate.c @@ -84,7 +84,10 @@ interpfilt_process(void) waypoint *wpt_new = waypt_dupe(wpt); wpt_new->creation_time = timen; xfree(wpt_new->shortname); - xfree(wpt_new->description); + if (wpt_new->description) { + xfree(wpt_new->description); + wpt_new->description = NULL; + } wpt_new->shortname = wpt_new->description = 0; linepart( lat1, lon1, wpt->latitude, wpt->longitude, @@ -110,7 +113,10 @@ interpfilt_process(void) wpt_new->creation_time = distn/curdist* (wpt->creation_time - time1) + time1; xfree(wpt_new->shortname); - xfree(wpt_new->description); + if (wpt_new->description) { + xfree(wpt_new->description); + wpt_new->description = NULL; + } wpt_new->shortname = wpt_new->description = 0; linepart( lat1, lon1, wpt->latitude, wpt->longitude, -- 2.30.2